﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PurchaseOrder_Import.aspx.cs"
    Inherits="Main_Reports_Inventory_PurchaseOrder_Import" Culture="en-GB" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControl" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../../Styles/accounts.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #overlay
        {
            position: fixed;
            z-index: 99;
            top: 0px;
            left: 0px;
            background-color: #f8f8f8;
            width: 100%;
            height: 100%;
            filter: Alpha(Opacity=90);
            opacity: 0.9;
            -moz-opacity: 0.9;
        }
        #theprogress
        {
            background-color: #fff;
            border: 1px solid #ccc;
            padding: 10px;
            width: 300px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            filter: Alpha(Opacity=100);
            opacity: 1;
            -moz-opacity: 1;
        }
        #modalprogress
        {
            position: absolute;
            top: 40%;
            left: 50%;
            margin: -11px 0 0 -150px;
            color: #990000;
            font-weight: bold;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true">
    </asp:ScriptManager>
    <acc:heading ID="pagehead" runat="server" HeadingText="Purchase Report Import" />
    <asp:UpdateProgress ID="prgLoadingStatus" AssociatedUpdatePanelID="UPbtngetreport"
        runat="server" DynamicLayout="true">
        <ProgressTemplate>
            <div id="overlay">
                <div id="modalprogress">
                    <div id="theprogress">
                        <asp:Image ID="imgWaitIcon" runat="server" ImageAlign="AbsMiddle" ImageUrl="~/Images/pleasewait.gif" /><br />
                        Please wait...
                    </div>
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div style="width: 98%;">
        <table style="background-color: #EEEEEE; width: 130%; height: 30px;">
            <tr>
                <td style="width: 5%;">
                    <asp:Label ID="lblRecordNo" runat="server"></asp:Label>
                </td>
                <td style="width: 12%;">
                    <asp:Label ID="lblperiod" runat="server"></asp:Label>
                </td>
                <td style="width: 7%;">
                    <span>From</span>
                </td>
                <td style="width: 2%;">
                    <asp:TextBox ID="txtfromdate" CssClass="input" Width="80px" runat="server"></asp:TextBox>
                </td>
                <td style="width: 2%;">
                    <asp:ImageButton ID="imgfromdate" runat="server" ImageUrl="~/Images/calendar.gif" />
                    <AjaxControl:CalendarExtender ID="calFrom" runat="server" PopupButtonID="imgfromdate"
                        Format="dd/MM/yyyy" TargetControlID="txtfromdate">
                    </AjaxControl:CalendarExtender>
                </td>
                <td style="width: 2%;">
                    To
                </td>
                <td style="width: 2%;">
                    <asp:TextBox ID="txttodate" CssClass="input" Width="80px" runat="server" onKeyPress="return isNumberKey(this.id,event);"></asp:TextBox>
                </td>
                <td style="width: 2%;">
                    <asp:ImageButton ID="imgtoDate" runat="server" ImageUrl="~/Images/calendar.gif" />
                    <AjaxControl:CalendarExtender ID="calto" runat="server" PopupButtonID="imgtoDate"
                        Format="dd/MM/yyyy" TargetControlID="txttodate">
                    </AjaxControl:CalendarExtender>
                </td>
                <td style="width: 5%;">
                    <asp:UpdatePanel ID="UPbtngetreport" runat="server">
                        <ContentTemplate>
                            <asp:Button ID="btngetreport" runat="server" Text="Report" CssClass="button1" OnClick="btngetreport_Click"
                                OnClientClick="return getcheck();" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <script type="text/javascript">
                        function getcheck() {
                            if (document.getElementById("txtfromdate").value == '') {
                                alert("Please Select From Date.");
                                document.getElementById("txtfromdate").focus();
                                return false;
                            }
                            else if (document.getElementById("txttodate").value == '') {
                                alert("Please Select To Date.");
                                document.getElementById("txttodate").focus();
                                return false;
                            }
                        }
                    </script>
                </td>
                <td align="right" style="width: 6%;">
                    <asp:Label ID="lblcolumnName" runat="server" Style="display: none;" Text="Column Name"></asp:Label>
                </td>
                <td style="width: 10%;">
                    <asp:DropDownList ID="ddlColumnname" Style="display: none;" runat="server" onchange="return ToHide_Show();"
                        CssClass="dropdown">
                        <asp:ListItem Value="0"> - Select Column(s) - </asp:ListItem>
                        <asp:ListItem Value="1">Item Code</asp:ListItem>
                        <asp:ListItem Value="2">Item Name</asp:ListItem>
                        <asp:ListItem Value="3">PO Number</asp:ListItem>
                        <asp:ListItem Value="4">Currency</asp:ListItem>
                        <asp:ListItem Value="5">Folio No</asp:ListItem>
                        <asp:ListItem Value="6">Vendor Country</asp:ListItem>
                        <asp:ListItem Value="7">Invoice Value</asp:ListItem>
                        <asp:ListItem Value="8">Payment Terms</asp:ListItem>
                    </asp:DropDownList>
                    <script type="text/javascript">
                        function ToHide_Show() {
                            if (document.getElementById("ddlColumnname").value != "0") {
                                //document.getElementById("txtValue").style["display"] = "block";
                                //document.getElementById("lblvalue").style["display"] = "block";
                                //document.getElementById("btnReport").style["display"] = "block";                                                    
                            }
                            else {
                                //document.getElementById("txtValue").style["display"] = "none";
                                //document.getElementById("lblvalue").style["display"] = "none";
                                //document.getElementById("btnReport").style["display"] = "none";
                            }
                            document.getElementById("txtValue").value = '';
                        }
                    </script>
                </td>
                <td align="right" style="width: 2%;">
                    <asp:Label ID="lblvalue" runat="server" Style="display: none;" Text="Value"></asp:Label>
                </td>
                <td style="width: 5%;">
                    <asp:TextBox ID="txtValue" CssClass="input" Style="display: none;" Width="80px" runat="server"></asp:TextBox>
                </td>
                <td style="width: 3%;">
                    <asp:Button ID="btnSearch" runat="server" Text="Search" Style="display: none;" CssClass="button1"
                        OnClick="btnSearch_Click" />
                </td>
                <td style="width: 3%;" align="center">
                    <asp:ImageButton ID="imgbtnPrint" ToolTip="Print" Style="display: none;" runat="server"
                        Width="20px" OnClientClick="printpanel();" ImageUrl="../../../Images/print.png" />
                    <script type="text/javascript">
                        function printpanel() {
                            var printcontent = document.getElementById('grdViewPoStatus');
                            window.print(printcontent.innerHTML);
                        }
                    </script>
                </td>
                <td style="width: 3%; vertical-align: middle;" align="center">
                    <asp:ImageButton ID="ImgBtnExcel" ToolTip="Export to Excel" Style="display: none;"
                        runat="server" Width="20px" ImageUrl="~/Images/Excel.png" OnClick="ImgBtnExcel_Click" />
                </td>
            </tr>
        </table>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="grdPurchaseOrderImport" CssClass="gridview" runat="server" AutoGenerateColumns="false">
                    <Columns>
                        <asp:TemplateField HeaderText="Sr.No">
                            <ItemTemplate>
                                <%#Container.DataItemIndex+1%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Item Code" DataField="ITMCODE" />
                        <asp:BoundField HeaderText="Item Name" DataField="ITMDESC" />
                        <asp:BoundField HeaderText="Bin Ref" DataField="BINREF" />
                        <asp:BoundField HeaderText="Location ID" DataField="LOCATIONID" />
                        <asp:BoundField HeaderText="Project Name" DataField="PROJECTNAME" />
                        <asp:BoundField HeaderText="Item Group" DataField="IGRNAME" />
                        <asp:BoundField HeaderText="PO NO" DataField="PONO" ItemStyle-BackColor="#B3D6A2" />
                        <asp:BoundField HeaderText="PO Date" DataField="PODATE" ItemStyle-BackColor="#B3D6A2"
                            DataFormatString="{0:dd/MM/yyyy}" />
                        <asp:BoundField HeaderText="PO Item Qty" DataField="ITEMQTY" ItemStyle-BackColor="#B3D6A2"
                            DataFormatString="{0:0}" ItemStyle-HorizontalAlign="Right" />
                        <asp:BoundField HeaderText="Currency" DataField="CURRENCY" ItemStyle-BackColor="#B3D6A2" />
                        <asp:BoundField HeaderText="Folio No" DataField="FOLIONO" ItemStyle-BackColor="#B3D6A2" />
                        <asp:BoundField HeaderText="Invoice NO" DataField="INVOICENO" ItemStyle-BackColor="#B3D6A2" />
                        <asp:BoundField HeaderText="Invoice Date" DataField="INVOICEDATE" ItemStyle-BackColor="#B3D6A2"
                            DataFormatString="{0:dd/MM/yyyy}" />
                        <asp:BoundField HeaderText="Vendor Name" DataField="VENDORNAME" ItemStyle-BackColor="#B3D6A2" />
                        <asp:BoundField HeaderText="City" DataField="CITY" ItemStyle-BackColor="#B3D6A2" />
                        <asp:BoundField HeaderText="Country" DataField="COUNTRY" ItemStyle-BackColor="#B3D6A2" />
                        <asp:BoundField HeaderText="Invoice Value" DataField="INVOICEVALUE" ItemStyle-BackColor="#B3D6A2"
                            DataFormatString="{0:0.000}" ItemStyle-HorizontalAlign="Right" />
                        <asp:BoundField HeaderText="Purchase Received Date" DataField="RECEIVEDATE" ItemStyle-BackColor="#B3D6A2"
                            DataFormatString="{0:dd/MM/yyyy}" />
                        <asp:BoundField HeaderText="Purchase Received Qty" DataField="RECEIVEQTY" ItemStyle-BackColor="#B3D6A2"
                            DataFormatString="{0:0}" ItemStyle-HorizontalAlign="Right" />
                        <asp:BoundField HeaderText="Purchase Received Unit Price" DataField="UNITPRICE" ItemStyle-BackColor="#B3D6A2"
                            ItemStyle-HorizontalAlign="Right" />
                        <asp:BoundField HeaderText="Total Value Item" DataField="TOTALVALUEITEM" ItemStyle-BackColor="#B3D6A2"
                            ItemStyle-HorizontalAlign="Right" />
                    </Columns>
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
